<template>
    <div>
        <h1>本地Cookies、Session的操作</h1>
        <button @click="CookiesPut()">添加Cookies</button>
        <button @click="CookiesGet()">获取Cookies</button>
        <button @click="CookiesClear()">清空Cookies</button>
        <button @click="CookiesRemove()">移除Cookies</button>
        <button @click="SessionPut()">添加Session</button>
        <button @click="SessionGet()">获取Session</button>
        <button @click="SessionClear()">清空Session</button>
        <button @click="SessionRemove()">移除Session</button>
    </div>
</template>

<script>
    import {CookiesPut,CookiesGet,CookiesClear,CookiesRemove,SessionPut,SessionGet,SessionClear,SessionRemove} from '../../utils/dataStorage'
    export default {
        name: "test5",
        methods:{
            CookiesPut(){
                CookiesPut("C1",'C1Data');
                CookiesPut("C2",'C2Data');
                CookiesPut("C3",'C3Data');
            },
            CookiesGet(){
                this.$notify({
                    title: "",
                    message: CookiesGet("C1"),
                    type: 'success'
                });

            },
            CookiesClear(){
                CookiesClear();
            },
            CookiesRemove(){
                CookiesRemove("C1");
            },
            SessionPut(){
                SessionPut("S1",'S1Data');
                SessionPut("S2",'S3Data');
                SessionPut("S3",'S3Data');
            },
            SessionGet(){

                this.$notify({
                    title: "",
                    message:  SessionGet("S1"),
                    type: 'success'
                });
            },
            SessionClear(){
                SessionClear();
            },
            SessionRemove(){
                SessionRemove("S1");
            }
        }
    }
</script>

<style scoped>

</style>
